home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / turttleo.swf / scripts / DefineSprite_159_star / frame_1 / DoAction.as
Encoding:
Text File  |  2007-10-01  |  531 b   |  24 lines

  1. var playtoframe = this._totalframes - 1 - this._totalframes * Math.random() / 2;
  2. var xspeed = Math.random() * 5;
  3. if(Math.random() > 0.5)
  4. {
  5.    xspeed *= -1;
  6. }
  7. xspeed *= 0.8;
  8. this._yscale *= 0.6;
  9. this._xscale *= 0.6;
  10. var yspeed = 2 + Math.random() * 3;
  11. this.onEnterFrame = function()
  12. {
  13.    this._x += xspeed;
  14.    this._y -= yspeed;
  15.    this._yscale *= 0.98;
  16.    this._xscale *= 0.98;
  17.    yspeed -= 0.6;
  18.    if(this._currentframe >= playtoframe)
  19.    {
  20.       this._visible = false;
  21.       _parent.unloadMovie();
  22.    }
  23. };
  24.